<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button>搜索</button>
  <input type="text" value="输入内容">
</body>

</html>
<script>
  //获取元素
  var input = document.querySelector('input')
  var btn = document.querySelector('button')
  //注册事件
  btn.onclick = function () {
    input.value = '被单击了!'
    this.disabled = true;
  }
</script>